import { defineStore } from 'pinia'
import request from '@/utils/request.js'
import axios from 'axios'



const useGoodsStore = defineStore('goods', {
  state: () => ({
    warehouse_id: '',
    warehouse: '', //仓库名称
    goodsTable: {}, //物资表格数据
    percent: 0, //进度条
    page:{
      pagenum:'1',
      size:'10',
      total:''

    }
  }),
  actions: {
    async getMaterialHandler(params) {
      const res = await request.get('/queryMaterialList', {
        params
      })
      this.goodsTable = res.data
      // this.page.pagenum = res.data.current
      // this.page.size = res.data.size
      this.page.total = res.data.total



      // cosole.log('this.goodsTable', this.goodsTable)

      return res.data
    }
    
  }
})

export default useGoodsStore
